{include file="common/_meta" /}

<title>收款设置</title>
</head>

<body>
	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i> 首页
		<span class="c-gray en">&gt;</span>
		系统管理
		<span class="c-gray en">&gt;</span>
		收款设置
		<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);"
		 title="刷新">
			<i class="Hui-iconfont">&#xe68f;</i>
		</a>
	</nav>
	<div class="page-container">
		<form class="form form-horizontal" id="form-article-add">
			<div id="tab-system" class="HuiTab">
				<div class="tabBar cl">
					<span>收款设置</span>
				</div>
				<div class="tabCon">
					<div class="panel panel-default">
						<div class="panel-header">银行账户1</div>
						<div class="panel-body">
							<div class="row cl">
								<label class="form-label col-xs-4 col-sm-2">
									<span class="c-red">*</span>用户名：
								</label>
								<div class="formControls col-xs-3 col-sm-6">
									<input type="text" name="bankown1" id="website-title" placeholder="" value="{$receipt.bankown1}" class="input-text">
								</div>
							</div>
							<div class="row cl">
								<label class="form-label col-xs-4 col-sm-2">
									<span class="c-red">*</span>银行账户：
								</label>
								<div class="formControls col-xs-3 col-sm-6">
									<input type="text" name="banknum1" id="website-title" placeholder="" value="{$receipt.banknum1}" class="input-text">
								</div>
							</div>
							<div class="row cl">
								<label class="form-label col-xs-4 col-sm-2">
									<span class="c-red">*</span>开户行：
								</label>
								<div class="formControls col-xs-3 col-sm-6">
									<input type="text" name="bankname1" id="website-title" placeholder="" value="{$receipt.bankname1}" class="input-text">
								</div>
							</div>
						</div>
					</div>
					<div class="row cl">
					</div>
					<div class="panel panel-default">
						<div class="panel-header">银行账户2</div>
						<div class="panel-body">
							<div class="row cl">
								<label class="form-label col-xs-4 col-sm-2">
									<span class="c-red">*</span>用户名：
								</label>
								<div class="formControls col-xs-3 col-sm-6">
									<input type="text" name="bankown2" id="website-title" placeholder="" value="{$receipt.bankown2}" class="input-text">
								</div>
							</div>
							<div class="row cl">
								<label class="form-label col-xs-4 col-sm-2">
									<span class="c-red">*</span>银行账户：
								</label>
								<div class="formControls col-xs-3 col-sm-6">
									<input type="text" name="banknum2" id="website-title" placeholder="" value="{$receipt.banknum2}" class="input-text">
								</div>
							</div>
							<div class="row cl">
								<label class="form-label col-xs-4 col-sm-2">
									<span class="c-red">*</span>开户行：
								</label>
								<div class="formControls col-xs-3 col-sm-6">
									<input type="text" name="bankname2" id="website-title" placeholder="" value="{$receipt.bankname2}" class="input-text">
									<input type="text" name="alipay" id="website-title" placeholder="" value="" class="input-text" hidden>
									<input type="text" name="wechat" id="website-title" placeholder="" value="" class="input-text" hidden>
								</div>
							</div>
						</div>
					</div>
					<div class="row cl">
					</div>
					<div class="panel panel-default">
						<div class="panel-header">收款码</div>
						<div class="panel-body">
							<div class="row cl">
								<label class="form-label col-xs-4 col-sm-2">
									<span class="c-red">*</span>支付宝：
								</label>
								<div class="col-xs-3 col-sm-6">
									<img src="{$receipt.alipay}" title="支付宝码" alt="支付宝码" class="alipay" style="height:100px;width:100px">
								</div>
							</div>
							<div class="row cl">
								<label class="form-label col-xs-4 col-sm-2">
								</label>
								<div class="formControls col-xs-3 col-sm-6">
									<span class="btn-upload">
										<a href="javascript:void();" class="btn btn-primary radius">
										<i class="Hui-iconfont">&#xe642;</i> 浏览文件</a>
										<input type="file" onchange="eee('alipay',this)" multiple name="file_0" class="input-file">
									</span>
								</div>
							</div>
							<div class="row cl">
								<label class="form-label col-xs-4 col-sm-2">
									<span class="c-red">*</span>微信：
								</label>
								<div class="col-xs-3 col-sm-6">
									<img src="{$receipt.wechat}" title="微信支付码" alt="微信码" class="wechat" style="height:100px;width:100px">
								</div>
							</div>
							<div class="row cl">
								<label class="form-label col-xs-4 col-sm-2">
								</label>
								<div class="formControls col-xs-3 col-sm-6">
									<span class="btn-upload">
										<a href="javascript:void();" class="btn btn-primary radius">
										<i class="Hui-iconfont">&#xe642;</i> 浏览文件</a>
										<input type="file" onchange="eee('wechat',this)" multiple name="file_0" class="input-file">
									</span>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="row cl">
				<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
					<button onClick="return saveConfig();" class="btn btn-primary radius" type="submit">
						<i class="Hui-iconfont">&#xe632;</i> 保存</button>
					<button class="btn btn-default radius rst hidden" type="reset">&nbsp;&nbsp;重置&nbsp;&nbsp;</button>
				</div>
			</div>
		</form>
	</div>

	{include file="common/_footer" /}

	<!--请在下方写此页面业务相关的脚本-->
	<script type="text/javascript">
		$('.form input[name="WEB_STATUS"][value=' + "{:config('WEB_STATUS')}" + ']').attr("checked", true);
		$(function () {
			$('.skin-minimal input').iCheck({
				checkboxClass: 'icheckbox-blue',
				radioClass: 'iradio-blue',
				increaseArea: '20%'
			});
			$("#tab-system").Huitab({
				index: 0
			});
		});
		// /setting/saveinfo
		function saveConfig() {
			$.post("{:url('receipt')}", $('.form').serialize()).success(function (data) {
				layer.msg(data.msg);
				if (!data.code) {
					$('.rst').click();
				}
			});
			return false;
		}

		function eee(paytype,data) {
			var dada = $(data);
        var data = new FormData();
        data.append('file', dada[0].files[0]);
        var index = layer.load(1, { shade: false }); //0代表加载的风格，支持0-2
        $.ajax({
            url: '{:url("setting/upload")}',
            type: 'POST',
            data: data,
            cache: false,
            contentType: false,
            processData: false,
            success: function(data) {
                layer.msg(data.msg);
                if (data.code) {
                    $('.'+paytype).attr('src',data.data);
                    $('input[name="'+paytype+'"]').val(data.data);
                }
                layer.close(index);
            },
            error: function() {
                layer.close(index);
                layer.msg('上传出错');
            }
        });
    } 
	</script>
	<!--/请在上方写此页面业务相关的脚本-->
</body>

</html>